package com.hxkj.controller.userCenter;

import com.hxkj.domain.po.SysCooperation;
import com.hxkj.domain.vo.SysCooperationVO;
import com.hxkj.service.userCenter.SysCooperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@RestController
@RequestMapping(value = "/sysCooperation")
public class SysCooperationController {

    @Autowired
    private SysCooperationService sysCooperationService;

    @RequestMapping(value = "/addCooperation")
    public void addCooperation(@RequestBody SysCooperationVO sysCooperationVO) throws Exception{
        sysCooperationService.addCooperation(sysCooperationVO);
    }

    @RequestMapping(value = "/modifyCooperation")
    public void modifyCooperation(@ModelAttribute SysCooperation sysCooperation) throws Exception{
        sysCooperationService.modifyCooperation(sysCooperation);
    }

    @RequestMapping(value = "/addQQ")
    public void addQQ(@ModelAttribute SysCooperation sysCooperation) throws Exception{
        sysCooperationService.addQQ(sysCooperation);
    }

    @RequestMapping(value = "/getSysCooperation")
    public Callable<SysCooperationVO> getSysCooperation() throws Exception{
        return () -> sysCooperationService.getSysCooperation();
    }

    @RequestMapping(value = "/deleteCooperation")
    public void deleteCooperation(@ModelAttribute SysCooperation sysCooperation) throws Exception {
        sysCooperationService.deleteCooperation(sysCooperation);
    }
}
